<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content">
  <div class="top">
    <div class="left"></div>
    <div class="right"></div>
    <div class="center">
      <h1><?php echo $heading_title; ?></h1>
    </div>
  </div>
  <div class="middle">
    <div class="sort">
      <div class="div1">
        <select name="sort" onchange="location=this.value">
          <?php foreach ($sorts as $sorts) { ?>
          <?php if (($sort . '-' . $order) == $sorts['value']) { ?>
          <option value="<?php echo $sorts['href']; ?>" selected="selected"><?php echo $sorts['text']; ?></option>
          <?php } else { ?>
          <option value="<?php echo $sorts['href']; ?>"><?php echo $sorts['text']; ?></option>
          <?php } ?>
          <?php } ?>
        </select>
      </div>
      <div class="div2"><?php echo $text_sort; ?></div>
    </div>
      <?php for ($i = 0; $i < sizeof($products); $i = $i + 4) { ?>
      <ul class="list">
        <?php for ($j = $i; $j < ($i + 4); $j++) { ?>
        <?php if (isset($products[$j])) { ?>
		<li class="tip_trigger<?php if($j == $i+3) {echo ' right';} ?>">
		  <?php if($products[$j]['motangan']) { ?>
		  <div class="tip">
			<div class="top">
			  <?php echo $products[$j]['name']; ?>
			</div>
			<div class="bottom">
			  <div class="product_info">Giá:
			  <?php if ($display_price) { ?>
			  <?php if (!$products[$j]['special']) { ?>
			  <span style="color: #900; font-weight: bold;"><?php echo $products[$j]['price']; ?></span>
			  <?php } else { ?>
			  <span style="color: #900; font-weight: bold; text-decoration: line-through;"><?php echo $products[$j]['price']; ?></span> <span style="color: #FFF;"><?php echo $products[$j]['special']; ?></span>
			  <?php } ?>
			  <?php } ?><br/>
			  Model:
			  <span style="color:#00f;"><?php echo $products[$j]['model']; ?></span><br/>
			  <?php if ($products[$j]['baohanh']) { ?>
				  Bảo hành:
				  <span style="color:#00f;"><?php echo $products[$j]['baohanh']; ?> tháng</span><br/>
			  <?php } ?>
				  Kho hàng:
				  <span style="color:#00722D;"><?php echo $products[$j]['stock']; ?></span><br/>
			</div>
			<br/>
			<b>Thông số kỹ thuật:</b>
			<div class="motangan"><?php echo $products[$j]['motangan']; ?></div>
			</div>
		  </div>
		  <?php } ?>
          <a href="<?php echo $products[$j]['href']; ?>"><img src="<?php echo $products[$j]['thumb']; ?>"  alt="<?php echo $products[$j]['name']; ?>" /></a><br />
          <a href="<?php echo $products[$j]['href']; ?>"><?php echo $products[$j]['name']; ?></a><br />
          <?php if ($display_price) { ?>
          <?php if (!$products[$j]['special']) { ?>
          <span style="color: #900; font-weight: bold;"><?php echo $products[$j]['price']; ?></span><br />
          <?php } else { ?>
          <span style="color: #900; font-weight: bold; text-decoration: line-through;"><?php echo $products[$j]['price']; ?></span> <span style="color: #F00;"><?php echo $products[$j]['special']; ?></span>
          <?php } ?>
          <?php } ?>
		</td>
          <?php } ?>
        <?php } ?>
      </ul>
      <?php } ?>
    <div class="pagination"><?php echo $pagination; ?></div>
  </div>
  <div class="bottom">
    <div class="left"></div>
    <div class="right"></div>
    <div class="center"></div>
  </div>
</div>
<?php echo $footer; ?> 